#ifndef SQLDATADB_H
#define SQLDATADB_H

#include <QSqlDatabase>
#include <qDebug>
#include "pakservice.h"
#include "TileService.h"
#include "DataSource.h"

class pakServiceOption;
class TileServiceOption;
class sqlDataDb
{
public:
    sqlDataDb();
    void creatdb(QString name);
    void creatAndroid_metadata();
    void creattablesInfos();
    void creatbackInfo(QString name);
    void addInfosinfo(pakServiceOption option,rxtiler::Extent ext,QString type);
    void addInfosinfo(TileServiceOption option,rxtiler::Extent ext,QString type);

    void addbacksinfo(QString name,rxtiler::TileKey key,osg::Image *img,QString imaform);
    void addbacksinfoTerrain(QString name,rxtiler::TileKey key,osg::HeightField *dem,int demsize);

    bool IsTableExist(QString name);
    QByteArray getimge(osg::Image *img);

    QByteArray getTerrain(osg::HeightField *dem,int demsize);

    QString settablename(rxtiler::TileKey key,int num);

    void closedb();

private:
     QSqlDatabase m_db;
};

#endif // SQLDATADB_H
